//
// Created by liushuai on 2021/1/25.
//

#include "getGray.h"
vector<string> getGray(int n) {
    vector<string>result;
    if(n == 1){
        result.push_back("0");
        result.push_back("1");
        return result;
    }else{
        result = getGray(n-1);
        vector<string> current;
        for(int i=0;i<result.size();i++){
            current.push_back('0'+result[i]);
        }
        for(int i=result.size()-1;i>=0;i--){
            current.push_back('1'+result[i]);
        }
        return current;
    }
}